package com.muk.meis.model.service;

import com.muk.meis.MEISConstance.SCALE;
import com.muk.webframework.framework.model.service.BaseService;

public abstract class BaseMEISService extends BaseService {
	
	public BaseMEISService() {
		super("meis");
	}
	
	protected String templateSQLScale(SCALE scale, String sql) {
		if(SCALE.S1.equals(scale)){
		    sql = String.format(sql, " between 1 and 120");		
		} else if (SCALE.S11.equals(scale)) {
			sql = String.format(sql, " between 1 and 20");	
		} else if(SCALE.S12.equals(scale)){
			sql = String.format(sql, " between 21 and 40");
		} else if(SCALE.S13.equals(scale)){
			sql = String.format(sql, " between 41 and 60");	
		} else if(SCALE.S14.equals(scale)){
			sql = String.format(sql, " between 61 and 80");
		} else if(SCALE.S15.equals(scale)){
			sql = String.format(sql, " between 81 and 100");
		} else if(SCALE.S16.equals(scale)){
			sql = String.format(sql, " between 101 and 120");			
		} else if (SCALE.S2.equals(scale)) {
			sql = String.format(sql, " between 121 and 200");	
		} else if(SCALE.S3.equals(scale)){
			sql = String.format(sql, " between 201 and 300");	
		} else if(SCALE.S4.equals(scale)){
			sql = String.format(sql, " between 301 and 499");	
		} else if(SCALE.S5.equals(scale)){
			sql = String.format(sql, " between 500 and 1499");	
		} else if(SCALE.S6.equals(scale)){
			sql = String.format(sql, " between 1500 and 2499");	
		} else if(SCALE.S7.equals(scale)){
			sql = String.format(sql, " >= 2500 ");	
		}
		return sql;
	}	

}
